package db;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DbConnectionFactoryImpl implements DbConnectionFactory {
	
	private String url;
	private String id;
	private String pw;
	
    public DbConnectionFactoryImpl(){
    	try{
    		id = "system";
    		pw = "dhtmxpait#99";
    			      
    		url ="jdbc:oracle:thin:@dev.OSSTEM.COM:1521:dev";
            Class.forName("oracle.jdbc.driver.OracleDriver");
            
    	}catch(Exception e){
    		e.printStackTrace();
    	}
    }
    
	//get connection
	@Override
	public Connection getConnection() {
		Connection connection;
		try {
			connection =  DriverManager.getConnection(url,id,pw);
		} catch (SQLException e) {
			e.printStackTrace();
			connection = null;
		}
		return connection;
	}
}